package xmltomce;
import org.w3c.dom.Element;



public class DvdFolderXmlWriter extends XmlWriter {
	private Movie movie;
	
	public DvdFolderXmlWriter(Movie movie){
		this.movie = movie;
	}
	
	public void saveXmlFile(){
		String xmlFilePath = movie.getDvdFolder()+"\\"+movie.getTitle()+".dvdid";
		createDocument();
		createXmlStructure();
		printToFile(xmlFilePath);
	}
	
	protected void createXmlStructure(){
		Element root = dom.createElement("Disc");
		dom.appendChild(root);
		appendTextChild(root, "Name", movie.getTitle());
		appendTextChild(root, "ID", ""+movie.getXmlId());
	}
	
}
